// @ts-ignore
/* eslint-disable */
import {
  DeviceTypeParams,
  DeviceTypeResult,
  DeviceTypeResultItem,
} from '@/services/api/model/deviceTypeModel';
import { request } from '@umijs/max';
/** 获取设备 GET  */
export async function getDeviceTypeList(
  params?: DeviceTypeParams,
  options?: { [key: string]: any },
) {
  return request<DeviceTypeResult>(API_URL + '/superlink/api/devicetypes/v2/devicetypes', {
    method: 'GET',
    params,
    ...(options || {}),
  });
}

export async function delDevice(id: string) {
  return request(API_URL + '/superlink/api/devicetypes/delete/' + id, {
    method: 'DELETE',
  });
}

export async function createDeviceType(data: DeviceTypeResultItem) {
  return request(API_URL + '/superlink/api/devicetypes/create', {
    method: 'POST',
    data,
  });
}
export async function updateDeviceType(data: DeviceTypeResultItem) {
  return request(API_URL + '/superlink/api/devicetypes/update/' + data.token, {
    method: 'PUT',
    data,
  });
}

/** 获取设备类型详情 GET  */
export async function getDeviceTypeDetails(
  params: { includeAsset?: boolean; token: string },
  options?: { [key: string]: any },
) {
  return request<DeviceTypeResultItem>(API_URL + '/superlink/api/devicetypes/' + params.token, {
    method: 'GET',
    params,
    ...(options || {}),
  });
}
